﻿using ALMDDD.Domain.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace ALMDDD.Infrastructure.Mappings
{
    public class SysRoleMap : IEntityTypeConfiguration<Sys_Role>
    {
        public void Configure(EntityTypeBuilder<Sys_Role> builder)
        {
            builder.ToTable("sys_role");
            builder.HasKey(c => c.Id);
            //生成id
            builder.Property(c => c.Id)
                .HasColumnName("id");
            //生成备注
            builder.Property(c => c.Context)
                .HasColumnName("context")
                .HasColumnType("nvarchar(200)");
            //生成角色代码
            builder.Property(c => c.RoleCode)
                .HasColumnName("roleCode")
                .HasColumnType("varchar(20)");
            //生成角色名称
            builder.Property(c => c.RoleName)
                .HasColumnName("roleName")
                .HasColumnType("varchar(50)");
            //生成角色类型
            builder.Property(c => c.RoleType)
                .HasColumnName("roleType")
                .HasColumnType("varchar(20)");
            //生成操作人姓名
            builder.Property(c => c.TrxName)
                 .HasColumnName("trxName")
                 .HasColumnType("varchar(20)");
            //操作时间
            builder.Property(c => c.TrxTime)
                .HasColumnName("trxTime")
                .HasColumnType("datetime");
            //操作人
            builder.Property(c => c.TrxUser)
                .HasColumnName("trxUser")
                .HasColumnType("varchar(20)");





        }
    }
}
